package antani.client.widgets;

import antani.client.GWTClient;

import com.google.gwt.core.client.GWT;
import com.google.gwt.dom.client.DivElement;
import com.google.gwt.dom.client.TableRowElement;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.user.client.DOM;
import com.google.gwt.user.client.Event;
import com.google.gwt.user.client.ui.Widget;

public class ArtistItem extends Widget {

	interface MyUiBinder extends UiBinder<DivElement, ArtistItem> {
	}

	private static MyUiBinder uiBinder = GWT.create(MyUiBinder.class);

	@UiField
	DivElement artistName;

	String id;

	public ArtistItem(String id, String artist) {
		setElement(uiBinder.createAndBindUi(this));
		sinkEvents(Event.ONCLICK);

		artistName.setInnerText(artist);
		this.id=id;
	}

	public void onBrowserEvent(com.google.gwt.user.client.Event event) {
		if (DOM.eventGetType(event) == Event.ONCLICK)
			GWTClient.artistsPage.show(id);
	}
}
